Skip to content

241 architecture extend quality control configuration - #242

Merged
roryclaydon1994 merged 12 commits into
developfrom
241-architecture-extend-quality-control-configuration
Aug 18, 2026
Merged

241 architecture extend quality control configuration#242
roryclaydon1994 merged 12 commits into
developfrom
241-architecture-extend-quality-control-configuration

Conversation

@jeipollack

@jeipollack jeipollack commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends the Quality Control configuration framework to support configurable execution resources and metric resource requirements.

The configuration now allows quality metrics to declare the resources they require, while the configuration loader validates that those resources are available and that enabled rejection policies reference enabled quality metrics.

This provides the configuration foundation required by the Quality Control pipeline orchestration.

closes #241

What’s changed

  • Added configurable resource declarations through ResourcesConfig.
  • Added required_resources to QualityMetricConfig so metrics can declare the resources required for their computation.
  • Extended the QC YAML configuration with a generic resources section
  • Moved inference_config from metric-specific params to the resources section.
  • Updated the example QC configuration with more realistic metric-specific params arguments and values, while preserving params as the mechanism for metric-specific configuration.
  • Added validation of metric resource identifiers and availability.
  • Added validation to ensure enabled rejection policies reference configured and enabled quality metrics.
  • Integrated cross-section configuration validation into QualityControlConfigHandler.load().
  • Updated configuration examples and tests to cover resource declarations and validation.

How to test / verify

  • Run the Quality Control configuration unit tests:
    pytest tests/quality_control/test_config.py
  • Verify that valid QC configurations load successfully and invalid resource or rejection-policy references raise the expected ValueError.
  • Run the full test suite to verify that existing configuration behavior remains compatible.

Scope

  • Feature
  • Bug fix
  • Hotfix
  • Documentation / process change
  • Internal / refactor
  • Release

This PR is part of the Quality Control architecture introduced under #226 and provides configuration plumbing required by #240 (Quality Control pipeline orchestration).

Changelog

  • Changelog fragment added (if applicable)

Reviewer Checklist

  • The PR targets the correct base branch (develop, or main for release PRs)
  • The PR is assigned to the developer
  • Appropriate labels are applied
  • The PR is included in relevant projects and/or milestones
  • Description clearly explains what has changed
  • Issue references included, if applicable
  • Code and documentation adhere to current standards (ruff)
  • Documentation updates included, if relevant
  • CI tests are passing
  • All reviewer comments have been addressed

Next Steps / Notes

The resource configuration is intentionally generic. The current implementation supports declaring resources such as standard PSF inference configurations, while the pipeline orchestration will resolve and prepare the resources required by enabled metrics.

Resource generation, execution-context construction, and metric computation remain part of the Quality Control pipeline implementation in #240 and subsequent metric-specific work.

@jeipollack jeipollack added this to the Outlier Removal milestone Aug 9, 2026
@jeipollack jeipollack self-assigned this Aug 9, 2026
@jeipollack jeipollack added the enhancement New feature or request label Aug 9, 2026
@jeipollack jeipollack linked an issue Aug 9, 2026 that may be closed by this pull request
10 tasks
@jeipollack
jeipollack changed the base branch from main to develop August 9, 2026 11:30
Jennifer Pollack added 4 commits August 12, 2026 12:36
- Add resources section
- Add required_resources option for metrics
- Add params section with example parameters
- Add dataclass ResourcesConfig to store resources available parameters
- Add method parse_resources_config to parse resources config section
- Add validators to check for internal consistency between resources, metrics and rejection params
- Normalise doc string formats
- Add missing doc strings for parser methods
- Update changelog fragment re: quality control configuration framework
- Update/add config fixtures with resource sections
- Update existing tests to evaluate resource sections
- Add unit tests for parse resource section and validators
- Add integration test for loader that runs validator
@jeipollack
jeipollack force-pushed the 241-architecture-extend-quality-control-configuration branch from a5c1df3 to b0ab44f Compare August 12, 2026 10:37

@roryclaydon1994 roryclaydon1994 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Feedback

Great job, architecture clean and introduces minimal coupling and tests are comprehensive. Please see inline comments.

Comment thread src/wf_psf/quality_control/config.py
Comment thread src/wf_psf/quality_control/config.py Outdated
Comment thread src/wf_psf/quality_control/config.py
Comment thread src/wf_psf/quality_control/config.py Outdated
Comment thread src/wf_psf/tests/test_quality_control/config_test.py Outdated
Jennifer Pollack added 5 commits August 17, 2026 14:45
- Accept Mapping inputs instead of concrete dictionaries.
- Normalize mapped configuration data to dictionaries in the parsed configuration.
- Update parser terminology and docstrings accordingly.
- Simplify resource identifier validation into a single conditional.
- Reject identifiers containing more than one "." separator.
- Consolidate identifier validation tests using pytest.mark.parametrize.
- Consolidate unknown resource validation tests using pytest.mark.parametrize.
- Update parse_metrics_config to require required_resources to be a list.
- Add a TypeError test and fixture for a non-list required_resources value.
- Add a TypeError test and fixture for a non-string required_resources element.
- Remove the deprecated fixture YAML file.
@jeipollack

Copy link
Copy Markdown
Contributor Author

Thanks, @roryclaydon1994, again for the careful and thoughtful review! This iteration helped me identify a few additional improvements beyond the specific comments, including adding an explicit type check for required_resources with corresponding tests. I also found an unused/deprecated YAML fixture while reviewing the test configuration files and removed it.
I've addressed the review comments and pushed the updates. Ready for another look when you have a chance.

@roryclaydon1994
roryclaydon1994 merged commit 9b13461 into develop Aug 18, 2026
2 checks passed
@roryclaydon1994
roryclaydon1994 deleted the 241-architecture-extend-quality-control-configuration branch August 18, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

[ARCHITECTURE] Extend Quality Control Configuration for Resource Dependencies

2 participants